/**
 * Created by haocongshun on 2016/7/19.
 */
$(function () {
    $("#loginSub").click(function () {
        var status = document.getElementsByName("status");
        var flag = false;
        var data = {};
        for(var i=0; i<status.length; i++){
            if(status[i].checked){
                data.status=status[i].value;
               flag = true;
            }
        }
        if(!flag){
            alert("请选择登录身份！");
            return;
        }
        data.phone=$("#phone").val();
        data.passwd=$("#passwd").val();
        var url = "/TaskCollection/Login/checkLogin.wst";
        $.ajaxSetup({
            async : false
        });
        $.post(url,data,function (result) {
            if(result.msg==true){
                $("#formLogin").submit();
            }else {
                //$("#msg").html("<span>用户名或密码错误</span>");
                alert("用户名或密码错误");
            }
        },"json");
    });
});